package cn.edu.scau.sec.rw.model.pro_manage.simulation;

import java.util.Arrays;
import java.util.List;

/**
 * 模拟主要寄存器
 */
public class Register {
    private Integer AX = 0; //数据寄存器
    private Integer[] PSW = {0,0,0}; //状态寄存器,分别为{程序中断，时间中断，IO中断}
    private List<String> IR; //指令寄存器
    private Integer PC = 0; //程序计数器

    public Register() {
    }

    public Register(Integer AX, List<String> IR) {
        this.AX = AX;
        this.IR = IR;
    }

    public Integer getAX() {
        return AX;
    }

    public void setAX(Integer AX) {
        this.AX = AX;
    }

    public Integer[] getPSW() {
        return PSW;
    }

    public void setPSW(Integer[] PSW) {
        this.PSW = PSW;
    }

    public List<String> getIR() {
        return IR;
    }

    public void setIR(List<String> IR) {
        this.IR = IR;
    }

    public Integer getPC() {
        return PC;
    }

    public void setPC(Integer PC) {
        this.PC = PC;
    }

    @Override
    public String toString() {
        return "Register{" +
                "AX=" + AX +
                ", PSW=" + Arrays.toString(PSW) +
                ", IR=" + IR +
                ", PC=" + PC +
                '}';
    }
}
